package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo1 {
    public static void main(String[] args) {
        Map<String, Integer> map = new HashMap<>();
        Integer value = map.put("语文", 99);
        System.out.println(value);
        map.put("数学", 88);
        map.put("英语", 77);
        map.put("物理", 66);
        map.put("化学", 55);
        value = map.put("语文", 100);
        System.out.println(value);
        System.out.println(map);
        System.out.println(map.get("语文"));
        System.out.println(map.get("数学"));

        int size = map.size();
        System.out.println("size:"+size);
        value = map.remove("物理");
        System.out.println(value);
        System.out.println(map);

        System.out.println(map.isEmpty());

        System.out.println(map.containsKey("语文"));

        System.out.println(map.containsValue(8));

        map.clear();
        System.out.println(map);
    }
}
